package com.cy.pj.sys.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PageController {
    @GetMapping("/doIndexUI")
    public String doIndexUI(Model model) {
        String loginuser = "TonyMa";
        model.addAttribute("username", loginuser);
        return "starter";
    }

    //    动态建立控制层链路
    @RequestMapping("/{modules}/{moduleUI}")
    private String doModuleUI(@PathVariable String moduleUI) {
        return "sys/" + moduleUI;
    }


    @GetMapping("/doPageUI")
    private String doPageUI() {
        return "common/page";
    }

    @GetMapping("/doLoginUI")
    public String login() {
        return "login";
    }
}
